

import Vue from "vue";
import Vuex from "vuex";
 Vue.use(Vuex)


//  uni.getStorageSync('list')
 //类似于localstorage.getItem('list')


//  uni.setStorageSync('list',payload)
//类似于localstorage.setItem('list',payload)

 const store = new Vuex.Store({
    state:{
        list:uni.getStorageSync('list') || []
    },
    mutations:{
        setList(state,payload){
            state.list = payload
            //uniapp的本地存储，能兼容网页端
            uni.setStorageSync('list',payload)
        }
    }
    
 })

 export default store